﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="ReceiveDelivery.aspx.cs" Inherits="PresentationLayer.ReceiveDelivery" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <div align="center">
            <h1>Receive Delivery</h1>
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="List" ForeColor="Red" ValidationGroup="SearchGrp" />
                    <table>
                        <tr>
                            <td>
                                <fieldset>
                                    <legend>Filter By</legend>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblPONo" runat="server" Text="Purchase Order No"></asp:Label></td>
                                            <td>
                                                <asp:TextBox ID="txtPONo" runat="server" CssClass="form-control"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="rfvPONo" runat="server" ErrorMessage="*Please enter a Purchase Order No" ControlToValidate="txtPONo" ForeColor="Red" ValidationGroup="SearchGrp">*</asp:RequiredFieldValidator>
                                                <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="* Please enter a valid Purchase Order No" ControlToValidate="txtPONo" ForeColor="Red" MaximumValue="2147483647" MinimumValue="1" Type="Integer" ValidationGroup="SearchGrp">*</asp:RangeValidator>
                                                <asp:Label ID="lblError1" runat="server" ForeColor="Red"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Button ID="btnSearch" runat="server" Text="Filter" OnClick="btnSearch_Click" ValidationGroup="SearchGrp" CssClass="btn-info" />

                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <hr />
                    <br />
                    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
                    <br /><br />
                    <asp:Label ID="lblTitlePO" runat="server"></asp:Label>
                    <asp:GridView ID="gvDeliveryOrder" runat="server" AutoGenerateColumns="False" CssClass="table table-hover table-striped table-bordered table-condensed" Width="30%">
                        <Columns>
                            <asp:TemplateField HeaderText="Purchase Order ID" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblPOId" runat="server" Text='<%# Eval("POId") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Item Code" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblItemCode" runat="server" Text='<%# Eval("ItemCode") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Item Name">
                                <ItemTemplate>
                                    <asp:Label ID="lblItemName" runat="server" Text='<%# Eval("ItemName") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Quantity">
                                <ItemTemplate>
                                    <asp:Label ID="lblQuantity" runat="server" Text='<%# Eval("Quantity") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <br />
                    <hr />
                    <br />
                    <asp:Label ID="lblDateError" runat="server" ForeColor="Red"></asp:Label>
                    <asp:ValidationSummary ID="ValidationSummary2" runat="server" DisplayMode="List" ForeColor="Red" ValidationGroup="ConfirmGrp" />
                    <table>
                        <tr align="left">
                            <td>
                                <asp:Label ID="lblDeliveryOrderNo" runat="server" Text="Delivery Order No"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtDeliveryOrderNo" runat="server" CssClass="form-control"></asp:TextBox>
                                </td>
                            <td>
                                <asp:RequiredFieldValidator ID="rfvDeliveryOrderNo" runat="server" ErrorMessage="* Please enter a Delivery Order No" ControlToValidate="txtDeliveryOrderNo" ForeColor="Red" ValidationGroup="ConfirmGrp">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr align="left">
                            <td>
                                <asp:Label ID="lblDeliveryDate" runat="server" Text="Delivery Date"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtDeliveryDate" runat="server" Enabled="False" CssClass="form-control"></asp:TextBox>
                                </td>
                            <td>
                                <asp:ImageButton ID="ibtnCalendar" runat="server" Height="20px" ImageUrl="~/Images/calendar.jpg" Width="30px" OnClick="ibtnCalendar_Click" />
                                <asp:RequiredFieldValidator ID="rfvDeliveryDate" runat="server" ErrorMessage="* Please select a date" ControlToValidate="txtDeliveryDate" ForeColor="Red" ValidationGroup="ConfirmGrp">*</asp:RequiredFieldValidator>
                                <asp:Label ID="lblDateError1" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>
                                <asp:Calendar ID="CalendarDeliveryDate" runat="server" OnSelectionChanged="CalendarDeliveryDate_SelectionChanged" Visible="False" Width="258px"></asp:Calendar>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <asp:Button ID="btnConfirm" runat="server" Text="Confirm" OnClick="btnConfirm_Click" ValidationGroup="ConfirmGrp" CssClass="btn-primary" />
                </ContentTemplate>
            </asp:UpdatePanel>
            <br />
            <br />
        </div>
</asp:Content>
